package com.cloudfun.campusshare.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created by Huqin on 2020/2/10
 */
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "command_message")
public class CommandMessageEntity extends BaseEntity {

    @Id
    @Column(name = "id", nullable = false, unique = true, length = 40)
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    private String id;

    @Column(columnDefinition = "varchar(40) default null comment '设备型号'")
    private String deviceType;

    @Column(columnDefinition = "varchar(40) not null comment '设备id'")
    private String deviceId;

    @Column(columnDefinition = "varchar(128) not null comment '消息内容'")
    private String content;

    @Column(columnDefinition = "varchar(16) not null comment '校验和'")
    private String checksum;
}
